<?php
	session_start();
	

	include "../classes/DB.php";
	$profile=get_object_vars(unserialize($_SESSION['userProfile']));
	$idUsuario=$profile['data']['id_usuario'];
	$db=new DB();
	
	$query="delete from control_usuarios where Id_Usuario='{$idUsuario}'";
	$r=$db->query($query);
	
	$_SESSION = array();
	
	// If it's desired to kill the session, also delete the session cookie.
	// Note: This will destroy the session, and not just the session data!
	if (isset($_COOKIE[session_name()])) {
	   setcookie(session_name(), '', time()-42000, '/');
	}
	
	// Finally, destroy the session.
	session_destroy();
	header('Location: http://localhost/IRENK/');
?>